<div class="form">


<?php $form = $this->beginWidget('GxActiveForm', array(
	'id' => 'categories-form',
	'enableAjaxValidation' => false,
));
?>

	<p class="note">
		<?php echo AdminModule::t('Поля помеченные '); ?> <span class="required">*</span> <?php echo AdminModule::t('являются обязательными'); ?>.
	</p>

	<?php echo $form->errorSummary($model); ?>
		<div class="row">
		<?php echo $form->labelEx($model,'hidden'); ?>
		<?php echo $form->checkBox($model, 'hidden'); ?>
		<?php echo $form->error($model,'hidden'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model, 'name', array('maxlength' => 100)); ?>
		<?php echo $form->error($model,'name'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'service_type'); ?>
		<?php  
            echo $form->dropDownList($model, 'service_type', Controller::getServiceTypes(),
            array(
                'ajax' => array(
                    'type'=>'POST', //request type
                    'url'=> $this->createUrl('/admin/default/modelkeyoptions'),
                    'update'=>'#dropdown_rubrics',
                    'data'=>array('service_type'=>'js:this.value', 'pkey'=>'service_type', 'model'=>'Rubrics', 'ovkey'=>'id', 'olkey' => 'name', /*'dvkey'=> '', 'dlkey'=>AdminModule::t('Все')*/),
                )
            ));
        ?>
		<?php echo $form->error($model,'service_type'); ?>
		</div><!-- row -->
		<div class="row">
        <?php $service_type = (null != $model->service_type) ? $model->service_type : 0; ?>
		<?php echo $form->labelEx($model,'rubric_id'); ?>
		<?php echo $form->dropDownList($model, 'rubric_id', GxHtml::listDataEx(Rubrics::model()->visible()->servicetype($service_type)->findAllAttributes(null, true)), array('id'=>'dropdown_rubrics')); ?>
		<?php echo $form->error($model,'rubric_id'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model, 'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
		</div><!-- row -->
<?php
echo GxHtml::submitButton(AdminModule::t('Сохранить'));
$this->endWidget();
?>
</div><!-- form -->